<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>后台管理系统</title>
    <link rel="stylesheet" href="css/layui.css">
    <script src="js/jquery-3.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(()=>{
            if(localStorage.getItem("admin")){
                let user = localStorage.getItem("admin");
                user = JSON.parse(user);
                $("#user-name").text(user.userName);
                $("#user-img").attr("src","data:image/jpeg;base64,"+user.imgBase64+"");
            }else{
                alert("你的登录已过期，请重新登陆");
                window.location.href="login.html"
            }
        })
        let layOut = ()=>{
            if(window.confirm("确认退出吗？")){
                localStorage.clear();
                window.location.href="login.html"
            }
        }
    </script>
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">商品管理系统</div>
        <!-- 头部区域（可配合layui 已有的水平导航） -->
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img id="user-img" src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" class="layui-nav-img">
                     <span id="user-name">天启</span>
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">通知</a></dd>
                    <dd><a href="">资料</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="javascript:layOut()">退出系统</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">商品管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="iframe/push_good.html">发布商品</a></dd>
                        <dd><a href="iframe/show_good.html">查看商品</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">信息管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="iframe/my_data.html">个人信息</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">订单管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;">查看订单</a></dd>
                        <dd><a href="javascript:;">删除订单</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">仓库管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;">新增货源</a></dd>
                        <dd><a href="javascript:;">查看货源</a></dd>
                        <dd><a href="javascript:;">解除货源</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">在线开发</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;">功能设计</a></dd>
                        <dd><a href="javascript:;">移动设计</a></dd>
                        <dd><a href="javascript:;">报表设计</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">
            <iframe src="" width="100%" height="684px" style="border: none" id="iframeMain">

            </iframe>
        </div>
    </div>

    <div class="layui-footer" style="text-align: center">
        <!-- 底部固定区域 -->
        java企业级开发大作业
    </div>
</div>
<script src="js/jquery-3.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function(){
        $(".layui-nav-child a").click(function(e){
            e.preventDefault();
            $("#iframeMain").attr("src",$(this).attr("href"));
        })
    })
</script>

<script src="js/layui.js" type="text/javascript"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;
    });
</script>
</body>
</html>